<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">

<head>
<title>js第1课-初识函数</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="这是js第1课-初识函数">
<style>
#div1 {
	width: 200px;
	height: 200px;
	background: red;
}
</style>
<script>
	function toGreen() {
		document.getElementById('div1').style.width = '300px';
		document.getElementById('div1').style.height = '500px';
		document.getElementById('div1').style.background = 'green';
	}

	function toRed() {
		document.getElementById('div1').style.width = '200px';
		document.getElementById('div1').style.height = '200px';
		document.getElementById('div1').style.background = 'red';
	}
</script>

</head>
<body>
	<div id="div1" onmouseover="toGreen()" onmouseout="toRed()"></div>
</body>
</html>